package com.glela.live.dao.impl;

import com.glela.live.dao.PublishHistoryDao;
import com.glela.live.mapper.PublishHistoryMapper;
import com.glela.live.model.PublishHistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class PublishHistoryDaoImpl implements PublishHistoryDao{

    @Autowired
    private PublishHistoryMapper publishHistoryMapper;

    @Override
    public PublishHistory addPublish(PublishHistory publishHistory) {
        int count = publishHistoryMapper.addPublish(publishHistory);
        if (count>0){
            return publishHistory;
        }
        return null;
    }

    @Override
    public List<PublishHistory> getPageList() {
        return publishHistoryMapper.getPageList();
    }

    @Override
    public PublishHistory getLastBegin(String streamName) {
        return publishHistoryMapper.getLastBegin(streamName);
    }
}
